/**
 * @name Button
 * @author darcrand
 * @desc
 */

import React from 'react'
import styles from './styles.module.less'

function Button({ children, disable = false, type = 'primary', onClick = () => {} }) {
  const styleNames = [styles.button]
  type && styleNames.push(styles[type])
  disable && styleNames.push(styles.disable)
  const computedStyle = styleNames.join(' ')

  return (
    <span className={computedStyle} onClick={onClick}>
      {children}
    </span>
  )
}

export default Button
